uses
  SysUtils;
var
  FormatSettings: TFormatSettings;
  I: Integer;
  S: String;
begin
  if ParamStr(1) = '' then begin
    Writeln('Usage: dtime "format"');
    Writeln('  c      shortdateformat + '' '' + longtimeformat');
    Writeln('  d      day of month');
    Writeln('  dd     day of month (leading zero)');
    Writeln('  ddd    day of week (abbreviation)');
    Writeln('  dddd   day of week (full)');
    Writeln('  ddddd  shortdateformat');
    Writeln('  dddddd longdateformat');
    Writeln('  m      month');
    Writeln('  mm     month (leading zero)');
    Writeln('  mmm    month (abbreviation)');
    Writeln('  mmmm   month (full)');
    Writeln('  y      year (2 digits)');
    Writeln('  yy     year (two digits)');
    Writeln('  yyyy   year (with century)');
    Writeln('  h      hour');
    Writeln('  hh     hour (leading zero)');
    Writeln('  n      minute');
    Writeln('  nn     minute (leading zero)');
    Writeln('  s      second');
    Write('(press enter)'); Readln;
    Writeln('  ss     second (leading zero)');
    Writeln('  t      shorttimeformat');
    Writeln('  tt     longtimeformat');
    Writeln('  am/pm  use 12 hour clock and display am and pm accordingly');
    Writeln('  a/p    use 12 hour clock and display a and p accordingly');
    Writeln('  /      insert date seperator');
    Writeln('  :      insert time seperator');
    Writeln('  "xx"   literal text');
    Writeln('  ''xx''   literal text');
    Writeln('  z      milliseconds');     
  end else begin
    with FormatSettings do begin
      CurrencyFormat := 1;
      NegCurrFormat := 5;
      ThousandSeparator := ',';
      DecimalSeparator := '.';
      CurrencyDecimals := 2;
      DateSeparator := '-';
      TimeSeparator := ':';
      ListSeparator := ',';
      CurrencyString := '$';
      ShortDateFormat := 'd/m/y';
      LongDateFormat := 'dd" "mmm" "yyyy';
      TimeAMString := 'AM';
      TimePMString := 'PM';
      ShortTimeFormat := 'hh:nn';
      LongTimeFormat := 'hh:nn:ss';
      ShortMonthNames[01] := 'Jan';
      ShortMonthNames[02] := 'Feb';
      ShortMonthNames[03] := 'Mar';
      ShortMonthNames[04] := 'Apr';
      ShortMonthNames[05] := 'May';
      ShortMonthNames[06] := 'Jun';
      ShortMonthNames[07] := 'Jul';
      ShortMonthNames[08] := 'Aug';
      ShortMonthNames[09] := 'Sep';
      ShortMonthNames[10] := 'Oct';
      ShortMonthNames[11] := 'Nov';
      ShortMonthNames[12] := 'Dec';
      LongMonthNames[01] := 'January';
      LongMonthNames[02] := 'February';
      LongMonthNames[03] := 'March';
      LongMonthNames[04] := 'April';
      LongMonthNames[05] := 'May';
      LongMonthNames[06] := 'June';
      LongMonthNames[07] := 'July';
      LongMonthNames[08] := 'August';
      LongMonthNames[09] := 'September';
      LongMonthNames[10] := 'October';
      LongMonthNames[11] := 'November';
      LongMonthNames[12] := 'December';
      ShortDayNames[1] := 'Sun';
      ShortDayNames[2] := 'Mon';
      ShortDayNames[3] := 'Tue';
      ShortDayNames[4] := 'Wed';
      ShortDayNames[5] := 'Thu';
      ShortDayNames[6] := 'Fri';
      ShortDayNames[7] := 'Sat';
      LongDayNames[1] := 'Sunday';
      LongDayNames[2] := 'Monday';
      LongDayNames[3] := 'Tuesday';
      LongDayNames[4] := 'Wednesday';
      LongDayNames[5] := 'Thursday';
      LongDayNames[6] := 'Friday';
      LongDayNames[7] := 'Saturday';
      TwoDigitYearCenturyWindow := 50;
    end;
    S := '';
    for I := 1 to ParamCount - 1 do
      S := S + ParamStr(I) + ' ';
    S := S + ParamStr(ParamCount);
    Write(FormatDateTime(S, Now{, FormatSettings}));
  end;
end.
